<!DOCTYPE html>  
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN"> 
<head> 
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>退款申请</title>
	<!-- 常规css -->
    <link th:href="@{bootstrap/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{font-awesome/css/font-awesome.min.css}" rel="stylesheet" />
    <!-- 项目css -->
    <link th:href="@{css/layout.css}" rel="stylesheet" />
</head> 
<body th:with="asort=${#httpServletRequest.getParameter('sort')}, aorder=${#httpServletRequest.getParameter('order')}, num=${data.num}, pageIndex=${data.pageIndex}, arefundStatus=${#httpServletRequest.getParameter('refundStatus')} ">
	<!-- 侧边导航栏 -->
	<div th:replace="aframe::sideNavigation"></div>
	
	<!-- 主页面 -->
	<div class="content" style="padding:0">
		<!-- 顶部导航栏 -->
		<div th:replace="aframe::topNavigation"></div>
		<!-- 内容 -->

		<!-- 标签页内容 -->
		<div role="tabpanel" class="tab-pane active" id="history" style="margin:20px">
			<div class="panel panel-default" >
				<div class="panel-heading" style="height: 100px">
					<h4>退款申请管理&nbsp;&nbsp;</h4>
					<!-- 筛选 -->
					<form action="" method="get">
					<div class="form-group">
						<span class="control-label sort-title col-sm-6">退款状态</span>
						<select class="form-control sort-content col-sm-6" name="refundStatus" id="s_refundStatus">
							<option value="-1" th:selected="${arefundStatus}==-1">全部</option>
							<option value="0" th:selected="${arefundStatus}==0">待处理</option>
							<option value="1" th:selected="${arefundStatus}==1">已受理</option>
							<option value="2" th:selected="${arefundStatus}==2">退款成功</option>
							<option value="3" th:selected="${arefundStatus}==3">退款失败</option>
						</select>
						<button type="submit" class="btn btn-default">筛选</button>
					</div>
					</form>
				</div>
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
						<tr>
							<th>退款编号</th>
							<th>订单编号</th>
							<th>商户订单号</th>
							<th>用户ID</th>
							<th>商品ID</th>
							<th>商品名</th>
							<th>商品数量</th>
							<th>订单价格</th>
							<th>退款原因</th>
							<th>退款状态</th>
							<th>请求时间</th>
							<th>受理时间</th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						<tr th:each="refund: ${data.list}">
							<th scope="row" th:text="${refund?.refundId}">编号</th>
							<td th:text="${refund?.ordersId}">订单编号</td>
							<td th:text="${refund?.outTradeNo}">商户订单号</td>
							<td th:text="${refund?.wxUserId}">用户id</td>
							<td th:text="${refund?.goodsId}">商品id</td>
							<td th:text="${refund?.goodsName}">商品名</td>
							<td th:text="${refund?.goodsCount}">商品数量</td>
							<td th:text="${refund?.refundPrice}">订单价格</td>
							<td th:text="${refund?.refundReason}">退款原因</td>
							<div th:switch="${refund?.refundStatus}">
								<td th:case="0">待处理</td>
								<td th:case="1">已受理</td>
								<td th:case="2">退款成功</td>
								<td th:case="3">退款失败</td>
							</div>
							<td th:text="${#dates.format(refund?.refundTime, 'yyyy-MM-dd')}">请求时间</td>
							<td th:text="${#dates.format(refund?.handleTime, 'yyyy-MM-dd')}">受理时间</td>
							<td>
								<button class="btn btn-sm btn-info" th:onclick="showDetail([[${refund?.refundId}]])">详情</button>
								<button class="btn btn-sm btn-success" th:if="${refund?.refundStatus eq 0}" th:onclick="showAgree([[${refund?.ordersId}]])">通过</button>
								<button class="btn btn-sm btn-danger" th:if="${refund?.refundStatus eq 0}" th:onclick="showReject([[${refund?.refundId}]])">拒绝</button>
							</td>
						</tr>
						</tbody>
					</table>

					<!-- 分页组件 -->
					<nav aria-label="Page navigation" th:fragment="pagingBar">
						<ul class="pagination">
							<!-- 上一页 -->
							<li>
								<a th:href="@{${#httpServletRequest.requestURL}(sort=${asort},order=${aorder},pageIndex=${data.pageIndex}-1,num=${data.num},totalPages=${data.totalPages})}" aria-label="Previous" th:if="${1 ne data.pageIndex}">
									<span aria-hidden="true">上一页</span>
								</a>
								<a href="#" th:if="${1 eq data.pageIndex}" style="color: #888888;pointer-events: none;">
									<span aria-hidden="true">上一页</span>
								</a>
							</li>
							<!-- 中间页 -->
							<li th:if="${data.totalPages>0}" th:each="pageIdx:${#numbers.sequence(1, data.totalPages)}">
								<a th:href="@{${#httpServletRequest.requestURL}(sort=${asort},order=${aorder},pageIndex=${pageIdx},num=${data.num},totalPages=${data.totalPages})}" th:text="${pageIdx}" th:if="${pageIdx ne data.pageIndex}"></a>
								<a href="#" th:text="${pageIdx}" th:if="${pageIdx eq data.pageIndex}" th:style="'font-weight:bold;background: #6faed9;pointer-events: none;'"></a>
							</li>
							<li th:if="${data.totalPages==0}">
								<a href="#" th:text="${1}" th:style="'font-weight:bold;background: #6faed9;pointer-events: none;'"></a>
							</li>
							<!-- 下一页 -->
							<li th:if="${data.totalPages>0}">
								<a th:href="@{${#httpServletRequest.requestURL}(sort=${asort},order=${aorder},pageIndex=${data.pageIndex}+1,num=${data.num},totalPages=${data.totalPages})}" aria-label="Next" th:if="${data.totalPages ne data.pageIndex}">
									<span aria-hidden="true">下一页</span>
								</a>
								<a href="#" th:if="${data.totalPages eq data.pageIndex}" style="color: #888888;pointer-events: none;">
									<span aria-hidden="true">下一页</span>
								</a>
							</li>
							<li th:if="${data.totalPages==0}">
								<a href="#" style="color: #888888;pointer-events: none;">
									<span aria-hidden="true">下一页</span>
								</a>
							</li>
						</ul>
					</nav>

				</div>
			</div>
		</div>
	</div>
		<!-- end 内容 -->
	<!-- end 主页面 -->

	<!-- 模态框: 信息 -->
	<form class="form-horizontal" role="form" id="detailForm" style="margin: 20px;">
		<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="detailModalLabel"> 商品信息 </h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">商品名称</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsName"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品参数</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsParam"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品类目</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsType"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品图片</label>
							<div class="col-sm-7">
								<img class="form-control-static" id="d_goodsPic" alt="商品图片" style="height:100px;max-height: 100px">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品价格</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsPrice"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品库存</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsStock"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品销量</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsSales"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商家名称</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_shopName"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品地址</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsAddr"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">加入时间</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsTime"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">修改时间</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_modifyTime"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">优惠活动</label>
							<div class="col-sm-7">
								<span class="label form-control-static" id="d_isOnsale">特价</span>
								<span class="label form-control-static" id="d_isSeckill">秒杀</span>
								<span class="label form-control-static" id="d_isAuction">拍卖</span>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 编辑 -->
	<form class="form-horizontal" role="form" id="editForm" style="margin: 20px;">
		<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="editModalLabel"> 商品编辑 </h4>
					</div>
					<div class="modal-body" style="height: 440px">
						<div class="col-sm-6">
							<div class="form-group">
								<input type="hidden" name="goodsId" id="e_goodsId">
								<label class="col-sm-3 control-label">商品名称</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="e_goodsName" name="goodsName" placeholder="请输入商品名称">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品参数</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="e_goodsParam" name="goodsParam" placeholder="请输入商品参数">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">选择类目</label>
								<div class="col-sm-7">
									<select name="goodsType" id="e_goodsType" class="form-control">
										<option value="0">不限</option>
										<option value="1">食品/保健类</option>
										<option value="2">服饰类</option>
										<option value="3">皮具箱包类</option>
										<option value="4">珠宝饰品类</option>
										<option value="5">母婴/儿童类</option>
										<option value="6">家电类</option>
										<option value="7">数码类</option>
										<option value="8">汽车配件类</option>
										<option value="9">家具/建材类</option>
										<option value="10">图书影音类</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">选择商家</label>
								<div class="col-sm-7">
									<select name="shopId" id="e_shopId" class="form-control">
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品价格</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="e_goodsPrice" name="goodsPrice" placeholder="请输入商品价格">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品库存</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="e_goodsStock" name="goodsStock" placeholder="请输入商品库存">
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-3 control-label">商品图片</label>
								<div class="col-sm-7">
									<input type="file" class="form-control" id="goodsPic" name="file" placeholder="请上传商品图片">
								</div>
							</div>
						</div>
						<div class="col-sm-6">
							<div class="form-group">
								<label class="col-sm-3 control-label">商品地址</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id='e_address' name="goodsAddr" placeholder="请输入地址或点击地图选择" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">经纬度</label>
								<div class="col-sm-7">
									<input readonly type="text" class="form-control" id='e_lnglat' name="lnglat" placeholder="点击按钮获取经纬度" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<input id="geoButton" type="button" class="btn" value="获取经纬度" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<div id="mapContainer" style="width: 230px; height: 230px; "></div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="editButton">确认修改</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 添加 -->
	<form class="form-horizontal" role="form" id="addForm" style="margin: 20px;">
		<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="addModalLabel"> 添加商品 </h4>
					</div>
					<div class="modal-body" style="height: 460px">
						<div class="col-sm-6">
							<div class="form-group">
								<input type="hidden" name="goodsId" id="a_goodsId">
								<label class="col-sm-3 control-label">商品名称</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="a_goodsName" name="goodsName" placeholder="请输入商品名称">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品参数</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="a_goodsParam" name="goodsParam" placeholder="请输入商品参数">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">选择类目</label>
								<div class="col-sm-7">
									<select name="goodsType" id="a_goodsType" class="form-control">
										<option value="0">不限</option>
										<option value="1">食品/保健类</option>
										<option value="2">服饰类</option>
										<option value="3">皮具箱包类</option>
										<option value="4">珠宝饰品类</option>
										<option value="5">母婴/儿童类</option>
										<option value="6">家电类</option>
										<option value="7">数码类</option>
										<option value="8">汽车配件类</option>
										<option value="9">家具/建材类</option>
										<option value="10">图书影音类</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">选择商家</label>
								<div class="col-sm-7">
									<select name="shopId" id="a_shopId" class="form-control">
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品价格</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="a_goodsPrice" name="goodsPrice" placeholder="请输入商品价格">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品库存</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id="a_goodsStock" name="goodsStock" placeholder="请输入商品库存">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">商品图片</label>
								<div class="col-sm-7">
									<input type="file" class="form-control" id="a_goodsPic" name="file" placeholder="请上传商品图片">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">是否上架</label>
								<div class="col-sm-7">
									<select name="isUpper" id="a_isUpper" class="form-control">
										<option value="0">暂不上架</option>
										<option value="1">立即上架</option>
									</select>
								</div>
							</div>
						</div>
						<div class="col-sm-6">
							<div class="form-group">
								<label class="col-sm-3 control-label">商品地址</label>
								<div class="col-sm-7">
									<input type="text" class="form-control" id='a_address' name="goodsAddr" placeholder="请输入地址或点击地图选择" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">经纬度</label>
								<div class="col-sm-7">
									<input readonly type="text" class="form-control" id='a_lnglat' name="lnglat" placeholder="点击按钮获取经纬度" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<input id="a_geoButton" type="button" class="btn" value="获取经纬度" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<div id="a_mapContainer" style="width: 230px; height: 230px; "></div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="addButton">确认添加</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 编辑商品详情 -->
	<form class="form-horizontal" role="form" style="margin: 20px;">
		<div class="modal fade" id="textModal" tabindex="-1" role="dialog" aria-labelledby="textModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="textModalLabel"> 详情编辑 </h4>
					</div>
					<div class="modal-body">
						<div id="wang_toolbar" class="toolbar">
						</div>
						<div style="padding: 3px 0; color: #ccc"></div>
						<div id="wang_text" class="text" style="height: 600px">
						</div>
						<input type="hidden" name="goodsId" id="t_goodsId">
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="textButton">确认修改</button>
					</div>
				</div>
			</div>
		</div>
	</form>


	<!-- 模态框: 修改密码 -->
	<div th:replace="aframe::modifyPwd"></div>


<!-- 常规js -->
<script th:src="@{js/jquery-3.4.1.min.js}"></script>
<script th:src="@{bootstrap/js/bootstrap.min.js}"></script>
<!-- 模板js -->
<script th:replace="aframe::js-highlight"></script>
<!-- 项目js -->
<script th:src="@{js/md5.js}"></script>
<script th:src="@{js/setpwd.js}"></script>
<!-- 页面js -->
<script th:src="@{js/refund.js}"></script>


</body>
</html> 

